package com.chenjun.core.dao.generator.mapper;

import com.chenjun.core.dao.generator.entity.OaBillAttnMonthReport;
import com.chenjun.core.dao.generator.entity.OaBillAttnMonthReportExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OaBillAttnMonthReportMapper {
    @Delete({
        "delete from oa_bill_attn_month_report",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into oa_bill_attn_month_report (id, no, ",
        "status, bill_date, create_time, ",
        "modify_time, note, ",
        "year, month, empl_id, ",
        "empl_code, empl_name, ",
        "man_hours_type_id, man_hours_type_name)",
        "values (#{id,jdbcType=INTEGER}, #{no,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=INTEGER}, #{billDate,jdbcType=DATE}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{modifyTime,jdbcType=TIMESTAMP}, #{note,jdbcType=VARCHAR}, ",
        "#{year,jdbcType=INTEGER}, #{month,jdbcType=INTEGER}, #{emplId,jdbcType=VARCHAR}, ",
        "#{emplCode,jdbcType=VARCHAR}, #{emplName,jdbcType=VARCHAR}, ",
        "#{manHoursTypeId,jdbcType=INTEGER}, #{manHoursTypeName,jdbcType=VARCHAR})"
    })
    int insert(OaBillAttnMonthReport record);

    int insertSelective(OaBillAttnMonthReport record);

    List<OaBillAttnMonthReport> selectByExample(OaBillAttnMonthReportExample example);

    @Select({
        "select",
        "id, no, status, bill_date, create_time, modify_time, note, year, month, empl_id, ",
        "empl_code, empl_name, man_hours_type_id, man_hours_type_name",
        "from oa_bill_attn_month_report",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    OaBillAttnMonthReport selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(OaBillAttnMonthReport record);

    @Update({
        "update oa_bill_attn_month_report",
        "set no = #{no,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=INTEGER},",
          "bill_date = #{billDate,jdbcType=DATE},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "modify_time = #{modifyTime,jdbcType=TIMESTAMP},",
          "note = #{note,jdbcType=VARCHAR},",
          "year = #{year,jdbcType=INTEGER},",
          "month = #{month,jdbcType=INTEGER},",
          "empl_id = #{emplId,jdbcType=VARCHAR},",
          "empl_code = #{emplCode,jdbcType=VARCHAR},",
          "empl_name = #{emplName,jdbcType=VARCHAR},",
          "man_hours_type_id = #{manHoursTypeId,jdbcType=INTEGER},",
          "man_hours_type_name = #{manHoursTypeName,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(OaBillAttnMonthReport record);
}